<div id="modal_window" class="contactform">
	<form>
		<fieldset>
			<legend>&nbsp;Nueva Plantilla de <?php echo $template_entity;?>&nbsp;</legend>
			<p>
				<label for="template_name" class="left" >Nombre:</label>
				<input type="text" id="template_name" name="template_name" class="field"></input>
			</p>
			<br></br>
			<p>
				<label for="applicable" class="left" >Aplicable a:</label>
				<select id="applicable" name="applicable" class="combo">
					<option value="all">Todos</option>
					<option value="male">Hombres</option>
					<option value="female">Mujeres</option>
				</select>
			</p>
			<br></br>
			<p>
				<label for="template_description" class="left" >Descripcion:</label>
				<textarea cols="30" rows="5" id="template_description" name="template_description"></textarea>
			</p>
			<br></br>
			<p>
				<input type="button" id="btnAddTemplate" name="btnAddTemplate" class="button" value="Guardar"></input>
			</p>
		</fieldset>
	</form>
</div>		
<script type="text/javascript">
			
	$j(document).ready(function(){
		$j("#btnAddTemplate").click(function(){
			 
			var datapayload = {
					template_name : $j("input#template_name").val(),
					applicable : $j("select#applicable").val(),
					template_description : $j("textarea#template_description").val(),
					btnAddTemplate : "Guardar" 
			};  

			$j.post('<?php echo $template_save_url;?>', datapayload,function(response){
				$j("div#modal_window").html(response);
				return false;		
			});
			
		});
	});
</script>